<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Modules\Admin\app\Http\Controllers\LoginController;
use Modules\Admin\app\Http\Middleware\JwtCheck;

/*
    |--------------------------------------------------------------------------
    | API Routes
    |--------------------------------------------------------------------------
    |
    | Here is where you can register API routes for your application. These
    | routes are loaded by the RouteServiceProvider within a group which
    | is assigned the "api" middleware group. Enjoy building your API!
    |
*/

Route::prefix('adminapi')->name('adminapi.')->group(function(){
    Route::match(['post', 'get'], 'login/captcha', [LoginController::class, 'captcha']);
    Route::match(['post', 'get'], 'login/index', [LoginController::class, 'login']);

    Route::middleware([JwtCheck::class])->group(function(){
        Route::match(['post', 'get'], 'login/userinfo', [LoginController::class, 'userinfo']);
    });
});



// Route::middleware(['auth:sanctum'])->prefix('v1')->name('api.')->group(function () {
//     Route::get('admin', fn (Request $request) => $request->user())->name('admin');
// });
